﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<NerdDinnerReloaded.Models.Dinner>" %>

<asp:Content ID="head" ContentPlaceHolderID="head" runat="server">
  <title>Create New Dinner</title>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
  <% Html.EnableClientValidation(); %>
  <h1>
    Create New Dinner</h1>
  <% using (Html.BeginForm())
     {%>
  <%: Html.ValidationSummary(true) %>
  <fieldset>
    <div class="editor-label">
      <%: Html.LabelFor(dinner => dinner.Title)%>
    </div>
    <div class="editor-field">
      <%: Html.TextBoxFor(dinner => dinner.Title)%>
      <%: Html.ValidationMessageFor(dinner => dinner.Title)%>
    </div>
    <div class="editor-label">
      <%: Html.LabelFor(dinner => dinner.EventDate)%>
    </div>
    <div class="editor-field">
      <%: Html.TextBoxFor(dinner => dinner.EventDate)%>
      <%: Html.ValidationMessageFor(dinner => dinner.EventDate)%>
    </div>
    <div class="editor-label">
      <%: Html.LabelFor(dinner => dinner.Address)%>
    </div>
    <div class="editor-field">
      <%: Html.TextBoxFor(dinner => dinner.Address)%>
      <%: Html.ValidationMessageFor(dinner => dinner.Address)%>
    </div>
    <div class="editor-label">
      <%: Html.LabelFor(dinner => dinner.HostedBy)%>
    </div>
    <div class="editor-field">
      <%: Html.TextBoxFor(dinner => dinner.HostedBy)%>
      <%: Html.ValidationMessageFor(dinner => dinner.HostedBy)%>
    </div>
    <p>
      <input type="submit" value="Create" />
    </p>
  </fieldset>
  <% } %>
  <div>
    <%: Html.ActionLink("Back to Dinners List", "Index") %>
  </div>
</asp:Content>
